# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Licensing.V1.Model.LicenseAssignment do
  @moduledoc """
  Representation of a license assignment.

  ## Attributes

  *   `etags` (*type:* `String.t`, *default:* `nil`) - ETag of the resource.
  *   `kind` (*type:* `String.t`, *default:* `licensing#licenseAssignment`) - Identifies the resource as a LicenseAssignment, which is `licensing#licenseAssignment`.
  *   `productId` (*type:* `String.t`, *default:* `nil`) - A product's unique identifier. For more information about products in this version of the API, see Product and SKU IDs.
  *   `productName` (*type:* `String.t`, *default:* `nil`) - Display Name of the product.
  *   `selfLink` (*type:* `String.t`, *default:* `nil`) - Link to this page.
  *   `skuId` (*type:* `String.t`, *default:* `nil`) - A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs.
  *   `skuName` (*type:* `String.t`, *default:* `nil`) - Display Name of the sku of the product.
  *   `userId` (*type:* `String.t`, *default:* `nil`) - The user's current primary email address. If the user's email address changes, use the new email address in your API requests. Since a `userId` is subject to change, do not use a `userId` value as a key for persistent data. This key could break if the current user's email address changes. If the `userId` is suspended, the license status changes.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :etags => String.t() | nil,
          :kind => String.t() | nil,
          :productId => String.t() | nil,
          :productName => String.t() | nil,
          :selfLink => String.t() | nil,
          :skuId => String.t() | nil,
          :skuName => String.t() | nil,
          :userId => String.t() | nil
        }

  field(:etags)
  field(:kind)
  field(:productId)
  field(:productName)
  field(:selfLink)
  field(:skuId)
  field(:skuName)
  field(:userId)
end

defimpl Poison.Decoder, for: GoogleApi.Licensing.V1.Model.LicenseAssignment do
  def decode(value, options) do
    GoogleApi.Licensing.V1.Model.LicenseAssignment.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Licensing.V1.Model.LicenseAssignment do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
